<script setup lang="ts">
import { RouterView, useRoute } from 'vue-router'
import { computed } from 'vue'
import Layout from './components/Layout.vue'
import TBoxSDK from './components/TBoxSDK.vue'

const route = useRoute()

// 安全地获取 hideLayout
const hideLayout = computed(() => {
  return route.meta?.hideLayout === true
})
</script>

<template>
  <div id="app">
    <!-- TBox SDK 组件 -->
    <TBoxSDK />
    
    <Layout v-if="!hideLayout">
      <RouterView />
    </Layout>
    <RouterView v-else />
  </div>
</template>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f7fa;
}

#app {
  min-height: 100vh;
}
</style>
